-- by Paul Sebastien, pauls@sirius.com, http://www.bitstream.net/psykosonik
-- The 'Pro' version of this behavior will feature automatic Beatnik instance selection for targetting specific instances, and more. For more info, go to http://www.headspace.com/
global beatnik
property pWhichEvent
property pWhichTrack
property pMuteState
on getPropertyDescriptionList
-- initialize the Beatnik Xtra instance
-- instantiation script (below) is commented out, as it is not necessary to instantiate a new instance, since we are just muting a track on an existing one named 'beatnik'. Please make sure that the instance that you want to perform the muting of tracks on is named 'beatnik', otherwise you should change the instance name in this script to match the instance name that you want to mute tracks on.
-- put "------------------------------"
-- if ilk(beatnik) = #instance then stop(beatnik)
-- set beatnik = VOID
-- set beatnik = new(xtra "beatnik",TRUE)
-- set bankFileName = the moviePath & "patches.hsb"
-- put "beatnik =" && beatnik
-- put "Bank =" && bankFileName
-- put "SetSampleLibrary(beatnik) = " & setsampleLibrary(beatnik, bankFileName)
-- put "SetReady(beatnik) = " & setReady(beatnik)
-- put "isReady(beatnik) = " & isReady(beatnik)
-- if not(isReady(beatnik)) then
-- alert "The Beatnik Xtra did not initialize, the Beatnik soundbank file 'patches.hsb' must be in the same folder as your current Director movie is in (or modify the path in the script). Also, make sure that the Xtra (BEATNIK.X32) is added to this movie."
-- exit
-- end if
-- -- finished initializing the Beatnik Xtra instance
addProp d, #pWhichTrack, [#default: "", #format: #integer, #comment: "Enter the number of the track to Mute/un-Mute:"]
addProp d, #pMuteState, [#default: "1", #format: #integer, #comment: "Enter '1' to Mute, or '0' to un-Mute this track:"]
return d
end
on doIt me
global beatnik
setTrackMute(beatnik, pWhichTrack, pMuteState)
end
on mouseDown me
if the pWhichEvent of me = #mouseDown then doIt me
end
on mouseUp me
if the pWhichEvent of me = #mouseUp then doIt me
end
on mouseEnter me
if the pWhichEvent of me = #mouseEnter then doIt me
end
on mouseLeave me
if the pWhichEvent of me = #mouseLeave then doIt me
end
on mouseWithin me
if the pWhichEvent of me = #mouseWithin then doIt me
end
on enterFrame me
if the pWhichEvent of me = #enterFrame then doIt me
end
on exitFrame me
if the pWhichEvent of me = #exitFrame then doIt me
end
on stopMovie
global beatnik
stop(beatnik)
closeBeatnik(beatnik)
set beatnik=VOID
end stopMovie
on getBehaviorDescription
set description = "MUTE TRACK LITE BEHAVIOR" && RETURN & "by Paul Sebastien pauls@sirius.com" && RETURN && RETURN & "This Beatnik Behavior allows you to mute or un-mute any track of an RMF file MIDI file playing through a Beatnik Xtra instance named 'beatnik'. You can edit this behavior's script to choose a different instance name if necessary." && RETURN && RETURN & "PARAMETERS:" && RETURN && RETURN & "ò Enter the number of the track to Solo/un-Solo:" && RETURN & "...Lets you specify which track in the RMF or MIDI file to mute or un-mute." && RETURN && RETURN & "ò Choose a trigger event:" && RETURN & "...Lets you choose which Director event you want to trigger the mute/un-mute function." && RETURN && RETURN & "IMPORTANT:" && RETURN &&RETURN & "- This behavior requires that the Beatnik Xtra Lite is properly added to your Director project, and also, the Beatnik soundbank (patches.hsb) must be in the same directory as your Director project file, otherwise you should change the path to the soundbank in this behavior's script if the soundbank resides elsewhere." && RETURN && RETURN & "- If you want to use this behavior to mute tracks on multiple files/instances simultaneously, you should modify the Beatnik instance name used in this behavior's script so it is unique for each instance. Currently, the instance name used is 'beatnik', so if you want to mute tracks on multiple instances or instances named something other than 'beatnik', you can modify the name in the script to 'beatnik2' and so on, as needed, to create multiple separate instances." && RETURN &&RETURN & "For more information on instantiating the Beatnik Xtra Lite, refer to the documentation or other Beatnik Xtra sample movies." && RETURN && RETURN & "To upgrade to Beatnik Behaviors Pro, or for more information on Beatnik-related products and music files, visit the Headspace web site at:" && RETURN && RETURN & "http://www.headspace.com"